import {
    BUILDER, DEFENDER,
    ENDER,
    HARVERSTER, HARVERSTER_MINERAL,
    LINKHARVERSTER,
    REPAIRER, TEMP_UPGRADER,
    TRANSPORTER,
    UPGRADER
} from "../../../constant/roleConstant.js";
import {transporterRun} from "../../../action/creep/transport.js";
import {upgraderRun} from "../../../action/creep/upgrader.js";
import {repairerRun} from "../../../action/creep/repairer.js";
import {harvesterRun} from "../../../action/creep/harvester.js";
import {builderRun} from "../../../action/creep/builder.js";
import {linkHarvesterRun} from "../../../action/creep/linkTransport.js";
import {defenderRun} from "../../../action/creep/defender.js";
import {tempUpgraderRun} from "../../../action/creep/temp-upgrader.js";
import {harvesterMineralRun} from "../../../action/creep/harvester-mineral.js";

/**
 * 3号房间
 */
export const E42N24 = {
    "transporter": {
        role: TRANSPORTER,
        bodys: Array(0).fill(WORK)
            .concat(Array(8).fill(CARRY))
            .concat(Array(8).fill(MOVE)),
        number: 2,
        weight: 1,
        func: transporterRun,
        sourcesIndex: 0
    },
    "upgrader": {
        role: UPGRADER,
        bodys: Array(9).fill(WORK)
            .concat(Array(9).fill(CARRY))
            .concat(Array(9).fill(MOVE)),
        number: 1,
        weight: 2,
        func: upgraderRun,
        sourcesIndex: 0
    },
    "repairer": {
        role: REPAIRER,
        bodys: Array(9).fill(WORK)
            .concat(Array(9).fill(CARRY))
            .concat(Array(9).fill(MOVE)),
        number: 1,
        weight: 3,
        func: repairerRun,
        sourcesIndex: 1
    },
    "harvester": {
        role: HARVERSTER,
        bodys: Array(5).fill(WORK)
            .concat(Array(1).fill(MOVE)),
        number: 1,
        weight: 2,
        func: harvesterRun,
        sourcesIndex: 0
    },
    "builder": {
        role: BUILDER,
        bodys: Array(9).fill(WORK)
            .concat(Array(9).fill(CARRY))
            .concat(Array(9).fill(MOVE)),
        number: 1,
        weight: 4,
        func: builderRun,
        sourcesIndex: 0
    },
    "linkHarvester": {
        role: LINKHARVERSTER,
        bodys: Array(5).fill(WORK)
            .concat(Array(10).fill(CARRY))
            .concat(Array(5).fill(MOVE)),
        number: 1,
        weight: 2,
        func: linkHarvesterRun,
        sourcesIndex: 1
    },
    "tempUpgrader": {
        role: TEMP_UPGRADER,
        bodys: Array(9).fill(WORK)
            .concat(Array(9).fill(MOVE))
            .concat(Array(9).fill(CARRY)),
        number: 0,
        weight: 3,
        func: tempUpgraderRun,
        sourcesIndex: 1
    },
    "ender": {
        role: ENDER,
        bodys: Array(1).fill(WORK)
            .concat(Array(2).fill(CARRY))
            .concat(Array(2).fill(MOVE)),
        number: 2,
        weight: 1,
        func: transporterRun,
        sourcesIndex: 0
    },
    "defender": {
        role: DEFENDER,
        bodys: Array(15).fill(TOUGH)
            .concat(Array(6).fill(MOVE))
            .concat(Array(2).fill(RANGED_ATTACK)),
        number: 1,
        weight: 2,
        func: defenderRun
    },
    "harvester-mineral": {
        role: HARVERSTER_MINERAL,
        bodys: Array(9).fill(WORK)
            .concat(Array(9).fill(MOVE))
            .concat(Array(9).fill(CARRY)),
        number: 1,
        weight: 4,
        func: harvesterMineralRun,
        sourcesIndex: 0
    },
}